<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = [{ name: 'zs', flag: true, count: 1 },
        { name: 'ls', flag: true, count: 1 },
        { name: 'ww', flag: true, count: 1 },
        { name: 'zl', flag: true, count: 1 },
        { name: 'lq', flag: true, count: 0 }]

        //要求每一个都符合条件
        let newVal = arr.every((val, index) => val.flag)
        console.log(newVal)

        let newVal1 = arr.every((val, index) => val.count)
        console.log(newVal1)
        //一个满足条件
        let newVal2 = arr.some((val, index) => val.count)
        console.log(newVal2)

        let newVal3 = arr.some(val => val.name)
        console.log(newVal3)
    </script>
</body>

</html>